Page({

        data: {
                auth_code:[],
        },
        onLoad: function (options) {
                this.setData({
                        auth_code:JSON.parse(decodeURIComponent(this.options.data))
                })
                // console.log(this.data.auth_code)
                wx.setNavigationBarTitle({
                        title: '第二步'
                        })
        },
        next_one(e){
                var num = e.detail.value.num
                // console.log(num)
                // console.log(this.data.auth_code)
                var my_id = this.data.auth_code.user_id
                // console.log(my_id)
                if(this.data.auth_code.auth_code == num){
                        wx.showModal({  
                                title: '验证码正确',  
                                content: "正在前往设置密码",  
                                success: function(res) {
                                if (res.confirm) {  
                                console.log('用户点击确定')  
                                wx.navigateTo({
                                url: '../next_two/next_two?cc=' + encodeURIComponent(JSON.stringify(my_id)),
                                })
                                } else if (res.cancel) {  
                                wx.navigateTo({
                                url: '../next_two/next_two?cc=' + encodeURIComponent(JSON.stringify(my_id)),
                                }) 
                                }  
                                }       
                        })
                }else {
                        wx.showToast({
                                title: '验证码错误',
                                icon: 'none',
                                duration: 2000,
                        })  
                }
        }
})

 

